//
//  MyWriteMoodViewController.m
//  SunXi
//
//  Created by dllo on 15/12/3.
//  Copyright © 2015年 大远. All rights reserved.
//

#import "MyWriteMoodViewController.h"

@interface MyWriteMoodViewController ()<UITextViewDelegate>
@property(nonatomic, retain) UITextView *textView;
@property(nonatomic, retain) UIButton *button;

@end

@implementation MyWriteMoodViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIImageView *imageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"drawBackPic.jpg"]];
    [self.view addSubview:imageview];
    [imageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(SV).with.insets(UIEdgeInsetsMake(0, 0, 0, 0));
    }];
    

    
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(WIDTH / 10, (HEIGHT - 64) / 10, WIDTH / 10 * 8, (HEIGHT-64) / 5 * 4)];
    self.textView.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:.5];
    self.textView.textAlignment = NSTextAlignmentLeft;
    [SV addSubview:self.textView];
    //可编辑
    self.textView.editable = NO;
    self.textView.delegate = self;
    self.textView.text = self.str;
    

    self.textView.font = [UIFont systemFontOfSize:16];
    
}

//MARK:button的点击方法
- (void)buttonAction:(UIButton *)button {
    
    if ([self.button.titleLabel.text  isEqualToString:@"修改"]) {
        self.textView.editable = NO;
        self.button.titleLabel.text = @"确定";
    }else {
        self.textView.editable = YES;
        self.button.titleLabel.text = @"修改";
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
